package com.yc.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author zwei
 * @create 2024-10-16 11:14
 */
public class ScheduledTaskService {
    private OrderBiz orderBiz;
    @Autowired
    public void setOrderBiz(OrderBiz orderBiz) {
        this.orderBiz = orderBiz;
    }
    @Scheduled(cron = "0 0 0 * * ?") // 每天的午夜（24点）
    public void performTask() {
        // 执行删除操作或其他逻辑
        orderBiz.deleteByColumnValue(0);
        System.out.println("每天24点执行任务");
    }
}
